<script>
	import globalData from "./utils/globalData.js"
	import {
		getAppId
	} from "./utils/platform.js"

	export default {
		globalData, // 整个应用可以直接访问到的一些全局数据

		onLaunch: function(options) {
			// 从活动页跳转
			if (options.query) {
				if (options.query.credit_goodsid) {
					this.$setGlobalData("credit_goodsid", (options.query.credit_goodsid).toString())
				}
				if (options.query.exclusivePrice) {
					this.$setGlobalData("exclusivePrice", (options.query.exclusivePrice).toString())
				}
			}
			// 非活动页跳转
			else {
				this.$setGlobalData("credit_goodsid", '')
				this.$setGlobalData("exclusivePrice", '')
			}
			console.log('App Launch', options);
			const infoObj = this.$getGlobalData("infoByAppId") || {}
			const appDescObj = infoObj[getAppId()] || {}
			this.$setGlobalData("information", appDescObj)
		},

		// 给全局开启分享行为
		onShareAppMessage() {
			return {}
		},
	}
</script>

<style lang="scss">
	/* 注意要写在第一行，同时给style标签加入lang="scss"属性 */
	@import "uview-ui/index.scss";
	
</style>
<style>
	@import '/common/css/lib.css';
</style>

